package com.hudongwx.shansun.activity;


import android.content.Intent;

import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import android.view.Gravity;

import android.view.View;
import android.widget.TextView;


import com.hudongwx.shansun.R;
import com.hudongwx.shansun.setting.AboutMeActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.x;

@ContentView(R.layout.activity_setting)
public class SettingActivity extends AppCompatActivity {
    private FinishProjectPopupWindow finishProjectPopupWindow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);
    }

    @Event(R.id.setting_tv_1)
    private void tv_1_btn(View view) {

        startActivity(new Intent(this, OpitionActivity.class));
    }

    @Event(R.id.setting_tv_2)
    private void tv_2_btn(View view) {
        startActivity(new Intent(this, AboutMeActivity.class));
    }

    @Event(R.id.setting_tv_3)
    private void tv_3_btn(View view) {
        finishProjectPopupWindow = new FinishProjectPopupWindow(this);
        finishProjectPopupWindow.showAtLocation(view, Gravity.BOTTOM, 0, 0);


    }

    @Event(R.id.setting_iv)
    private void ivBnt(View view) {
        finish();
    }

    @Event(R.id.setting_tv_5)
    private void tv_5_btn(View view) {

        final AlertDialog.Builder builder = new AlertDialog.Builder(this);
        View view1 = getLayoutInflater().inflate(R.layout.message_item, null);
        TextView tv = (TextView) view1.findViewById(R.id.message_tv_2);

        builder.setView(view1);

        final AlertDialog show = builder.show();
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                show.dismiss();
            }
        });

    }


}
